package net.dgg.rz.common.utils;

import net.dgg.framework.tac.utils.bean.DggRestResponse;

import java.util.List;
import java.util.Map;

/**
 * @className AppTableResponse
 * @Author Quanlin Wan APP列表返回数据机构
 * @Description //TODO
 * @Date 2019/4/11 16:57
 **/
public class AppTableResponse extends DggRestResponse {

    private Object recordsTotal;// 总记录数
    private Object recordsFiltered; // 当前记录数
    private Object size;// 页码
    private Object pageSize;//每页条数

    public AppTableResponse data(Map params, List<?> data) {
        this.recordsTotal = params.get("count");
        this.recordsFiltered = params.get("count");
        this.size = params.get("size");
        this.pageSize = params.get("pageSize");
        this.setData(data);
        return this;
    }

    public AppTableResponse data(List<?> data) {
        this.recordsTotal = 0;
        this.setData(data);
        return this;
    }

    public Object getRecordsTotal() {
        return recordsTotal;
    }

    public void setRecordsTotal(Object recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public Object getRecordsFiltered() {
        return recordsFiltered;
    }

    public void setRecordsFiltered(Object recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    public Object getSize() {
        return size;
    }

    public void setSize(Object size) {
        this.size = size;
    }

    public Object getPageSize() {
        return pageSize;
    }

    public void setPageSize(Object pageSize) {
        this.pageSize = pageSize;
    }
}
